package com.suxiaoxiao.springbootlearn.designpattern.commandpattern.commands.ceilingfan;

/**
 * 吊扇
 * @author 、
 */
public class CeilingFan {

    public static final int HIGH = 3;
    public static final int MEDIUM = 2;
    public static final int LOW = 1;
    public static final int OFF = 0;
    private String name;
    private int speed;

    public CeilingFan() {
    }

    public CeilingFan(String name) {
        this.name = name;
        speed = OFF;
    }

    public void high() {
        speed = HIGH;
        System.out.println(name + "CeilingFan speed is HIGH");
    }

    public void medium() {
        speed = MEDIUM;
        System.out.println(name + "CeilingFan speed is MEDIUM");
    }

    public void low() {
        speed = LOW;
        System.out.println(name + "CeilingFan speed is LOW");
    }

    public void off() {
        speed = OFF;
        System.out.println(name + "CeilingFan speed is OFF");
    }

    public int getSpeed() {
        return speed;
    }

}
